CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/next/pages/licenses/[[...page]].tsx
Views: 687
1
/*
2
* This file is part of CoCalc: Copyright © 2022 Sagemath, Inc.
3
* License: MS-RSL – see LICENSE.md for details
4
*/
5
6
import { Layout } from "antd";
7
8
import { capitalize } from "@cocalc/util/misc";
9
import Footer from "components/landing/footer";
10
import Head from "components/landing/head";
11
import Header from "components/landing/header";
12
import Licenses from "components/licenses/layout";
13
import { Customize } from "lib/customize";
14
import withCustomize from "lib/with-customize";
15
16
export default function Preferences({ customize, page }) {
17
const subpage = page[0] != null ? ` – ${capitalize(page[0])}` : "";
18
19
return (
20
<Customize value={customize}>
21
<Head title={`Licenses${subpage}`} />
22
<Layout>
23
<Header />
24
<Licenses page={page} />
25
<Footer />
26
</Layout>
27
</Customize>
28
);
29
}
30
31
export async function getServerSideProps(context) {
32
let { page } = context.params;
33
if (page == null) {
34
page = [];
35
}
36
37
return await withCustomize({ context, props: { page } });
38
}
39
40